<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />









  <meta name="baidu-site-verification" content="Q7ugSRSO7V" />







  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="Hexo, NexT" />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="匿名函数:官方解释: 匿名函数（Anonymous functions），也叫闭包函数（closures），允许 临时创建一个没有指定名称的函数。最经常用作回调函数（callback）参数的值。当然，也有其它应用的情况。闭包函数也可以作为变量的值来使用。PHP 会自动把此种表达式转换成内置类 Closure 的对象实例。把一个 closure 对象赋值给一个变量的方式与普通变量赋值的语法是一样的，">
<meta property="og:type" content="article">
<meta property="og:title" content="函数">
<meta property="og:url" content="http://yoursite.com/php/函数/index.html">
<meta property="og:site_name" content="chimps">
<meta property="og:description" content="匿名函数:官方解释: 匿名函数（Anonymous functions），也叫闭包函数（closures），允许 临时创建一个没有指定名称的函数。最经常用作回调函数（callback）参数的值。当然，也有其它应用的情况。闭包函数也可以作为变量的值来使用。PHP 会自动把此种表达式转换成内置类 Closure 的对象实例。把一个 closure 对象赋值给一个变量的方式与普通变量赋值的语法是一样的，">
<meta property="og:updated_time" content="2017-04-23T14:39:44.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="函数">
<meta name="twitter:description" content="匿名函数:官方解释: 匿名函数（Anonymous functions），也叫闭包函数（closures），允许 临时创建一个没有指定名称的函数。最经常用作回调函数（callback）参数的值。当然，也有其它应用的情况。闭包函数也可以作为变量的值来使用。PHP 会自动把此种表达式转换成内置类 Closure 的对象实例。把一个 closure 对象赋值给一个变量的方式与普通变量赋值的语法是一样的，">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"hide","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":30},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/php/函数/"/>





  <title> 函数 | chimps </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?dcb994042608bdb310eff950ba755ff1";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">chimps</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/php/函数/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="chimps">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="https://sfault-avatar.b0.upaiyun.com/416/326/4163260007-58a1621e63a68_huge256">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="chimps">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                函数
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2017-04-23T22:38:31+08:00">
                2017-04-23
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/php/" itemprop="url" rel="index">
                    <span itemprop="name">php</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <span class="post-meta-item-icon">
                  <i class="fa fa-comment-o"></i>
                </span>
                <a class="cloud-tie-join-count" href="/php/函数/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count join-count" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          
          

          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h1 id="匿名函数"><a href="#匿名函数" class="headerlink" title="匿名函数:"></a>匿名函数:</h1><h2 id="官方解释"><a href="#官方解释" class="headerlink" title="官方解释:"></a>官方解释:</h2><blockquote>
<p>匿名函数（Anonymous functions），也叫闭包函数（closures），允许 临时创建一个没有指定名称的函数。最经常用作回调函数（callback）参数的值。当然，也有其它应用的情况。<br>闭包函数也可以作为变量的值来使用。PHP 会自动把此种表达式转换成内置类 Closure 的对象实例。把一个 closure 对象赋值给一个变量的方式与普通变量赋值的语法是一样的，最后也要加上分号</p>
<h2 id="Closure对象"><a href="#Closure对象" class="headerlink" title="Closure对象"></a>Closure对象</h2><p>总共三个方法:<br><figure class="highlight php"><table><tr><td class="code"><pre><div class="line">Closure::__construct 用于禁止实例化的构造函数</div><div class="line">Closure::bind 复制一个闭包，绑定指定的<span class="keyword">$this</span>对象和类作用域。</div><div class="line">Closure::bindTo 复制当前闭包对象，绑定指定的<span class="keyword">$this</span>对象和类作用域。</div></pre></td></tr></table></figure></p>
</blockquote>
<p>除此之外还有一个<strong>invoke(当尝试以调用函数的方式调用一个对象时，</strong>invoke() 方法会被自动调用。)方法, 这是为了与其他实现了 <a href="http://php.net/manual/zh/language.oop5.magic.php# language.oop5.magic.invoke" target="_blank" rel="external">__invoke()</a>魔术方法 的对象保持一致性，但调用匿名函数的过程与它无关。</p>
<h2 id="bindTo"><a href="#bindTo" class="headerlink" title="bindTo"></a><a href="http://php.net/manual/zh/closure.bindto.php" target="_blank" rel="external">bindTo</a></h2><p>具体看文档, 例子:<br><figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">A</span> </span>&#123;</div><div class="line">    <span class="keyword">public</span> $param;</div><div class="line"></div><div class="line">    <span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">get</span><span class="params">($a)</span> </span>&#123;</div><div class="line"></div><div class="line">    &#125;</div><div class="line">&#125;</div><div class="line"></div><div class="line">$func = <span class="function"><span class="keyword">function</span> <span class="params">($param)</span> </span>&#123;</div><div class="line">    <span class="keyword">$this</span>-&gt;param = $param;</div><div class="line">&#125;;</div><div class="line">$a = <span class="keyword">new</span> A();</div><div class="line">$func1 = $func-&gt;bindTo($a, <span class="string">"A"</span>);</div><div class="line">$func1(<span class="number">12</span>);</div><div class="line"><span class="keyword">echo</span> $a-&gt;param;</div><div class="line"><span class="comment">//结果:</span></div><div class="line"><span class="number">12</span></div></pre></td></tr></table></figure></p>
<p>例子2(经常有php框架将路由绑定到一个函数中)<br><figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">App</span></span></div><div class="line">&#123;</div><div class="line">    <span class="keyword">protected</span> $routes = <span class="keyword">array</span>();</div><div class="line">    <span class="keyword">protected</span> $responseStatus = <span class="string">'200 OK'</span>;</div><div class="line">    <span class="keyword">protected</span> $responseContentType = <span class="string">'text/html'</span>;</div><div class="line">    <span class="keyword">protected</span> $responseBody = <span class="string">'Hello world'</span>;</div><div class="line"> </div><div class="line">    <span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">addRoute</span><span class="params">($routePath, $routeCallback)</span></span></div><div class="line">    &#123;</div><div class="line">        <span class="keyword">$this</span>-&gt;routes[$routePath] = $routeCallback-&gt;bindTo(<span class="keyword">$this</span>, <span class="keyword">__CLASS__</span>);</div><div class="line">    &#125;</div><div class="line"> </div><div class="line">    <span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">dispatch</span><span class="params">($currentPath)</span></span></div><div class="line">    &#123;</div><div class="line">        <span class="keyword">foreach</span> (<span class="keyword">$this</span>-&gt;routes <span class="keyword">as</span> $routePath =&gt; $callback) &#123;</div><div class="line">            <span class="keyword">if</span> ($routePath === $currentPath) &#123;</div><div class="line">                $callback();</div><div class="line">            &#125;</div><div class="line">        &#125;</div><div class="line"> </div><div class="line">        header(<span class="string">'HTTP/1.1 '</span> . <span class="keyword">$this</span>-&gt;responseStatus);</div><div class="line">        header(<span class="string">'Content-type: '</span> . <span class="keyword">$this</span>-&gt;responseContentType);</div><div class="line">        header(<span class="string">'Content-length: '</span> . mb_strlen(<span class="keyword">$this</span>-&gt;responseBody));</div><div class="line">        <span class="keyword">echo</span> <span class="keyword">$this</span>-&gt;responseBody;</div><div class="line">    &#125;</div><div class="line">&#125;</div></pre></td></tr></table></figure></p>
<p>调用:<br><figure class="highlight php"><table><tr><td class="code"><pre><div class="line">$app = <span class="keyword">new</span> App();</div><div class="line">$app-&gt;addRoute(<span class="string">'/users/josh'</span>, <span class="function"><span class="keyword">function</span> <span class="params">()</span> </span>&#123;</div><div class="line">    <span class="keyword">$this</span>-&gt;responseContentType = <span class="string">'application/json;charset=utf8'</span>;</div><div class="line">    <span class="keyword">$this</span>-&gt;responseBody = <span class="string">'&#123;"name": "Josh"&#125;'</span>;</div><div class="line">&#125;);</div><div class="line">$app-&gt;dispatch(<span class="string">'/users/josh'</span>);</div></pre></td></tr></table></figure></p>
<h1 id="函数赋值"><a href="#函数赋值" class="headerlink" title="函数赋值"></a>函数赋值</h1><ul>
<li><p>匿名函数赋值</p>
<figure class="highlight php"><table><tr><td class="code"><pre><div class="line">$func = <span class="function"><span class="keyword">function</span><span class="params">()</span></span>&#123;</div><div class="line">    <span class="keyword">echo</span> <span class="string">"hello func"</span>;</div><div class="line">&#125;;</div><div class="line">$func();</div></pre></td></tr></table></figure>
</li>
<li><p>普通函数赋值</p>
<figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="function"><span class="keyword">function</span> <span class="title">getName</span><span class="params">()</span></span>&#123;</div><div class="line">    <span class="keyword">echo</span> <span class="string">"zhangsan"</span>;</div><div class="line">&#125;</div><div class="line"></div><div class="line">$func = <span class="string">"getName"</span>;</div><div class="line"></div><div class="line">$func();</div></pre></td></tr></table></figure>
</li>
<li><p>类的方法赋值</p>
<figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="class"><span class="keyword">class</span> <span class="title">person</span> </span>&#123;</div><div class="line">    <span class="keyword">public</span> <span class="function"><span class="keyword">function</span> <span class="title">getName</span><span class="params">()</span> </span>&#123;</div><div class="line">        <span class="keyword">echo</span> <span class="string">"hello person"</span>;</div><div class="line">    &#125;</div><div class="line">&#125;</div><div class="line"></div><div class="line">$func = <span class="string">"getName"</span>;</div><div class="line">$zhangsan = <span class="keyword">new</span> person();</div><div class="line">$zhangsan-&gt;$func();</div></pre></td></tr></table></figure>
</li>
</ul>
<h1 id="常见函数"><a href="#常见函数" class="headerlink" title="常见函数"></a>常见函数</h1><h2 id="数组函数"><a href="#数组函数" class="headerlink" title="数组函数"></a>数组函数</h2><ul>
<li><p><code>array_splice</code>:替换数组（一般用于排序）<br>注意不能用于多维数组,例如：</p>
<figure class="highlight php"><table><tr><td class="code"><pre><div class="line">array_splice($arr, <span class="number">8</span>, <span class="number">0</span>, [<span class="string">'a'</span>=&gt;<span class="string">'ss'</span>, <span class="string">'b'</span>=&gt;<span class="string">'bb'</span>]);</div><div class="line"><span class="comment">// 结果:</span></div><div class="line"><span class="keyword">array</span>(<span class="number">8</span>) &#123;</div><div class="line">  [<span class="number">0</span>] =&gt;</div><div class="line">  int(<span class="number">1</span>)</div><div class="line">  [<span class="number">1</span>] =&gt;</div><div class="line">  int(<span class="number">2</span>)</div><div class="line">  [<span class="number">2</span>] =&gt;</div><div class="line">  int(<span class="number">3</span>)</div><div class="line">  [<span class="number">3</span>] =&gt;</div><div class="line">  int(<span class="number">4</span>)</div><div class="line">  [<span class="number">4</span>] =&gt;</div><div class="line">  int(<span class="number">5</span>)</div><div class="line">  [<span class="number">5</span>] =&gt;</div><div class="line">  int(<span class="number">6</span>)</div><div class="line">  [<span class="number">6</span>] =&gt;</div><div class="line">  string(<span class="number">2</span>) <span class="string">"ss"</span></div><div class="line">  [<span class="number">7</span>] =&gt;</div><div class="line">  string(<span class="number">2</span>) <span class="string">"bb"</span></div><div class="line">&#125;</div></pre></td></tr></table></figure>
</li>
<li><p><code>array_column</code>:二维数组转为一维数组</p>
<figure class="highlight php"><table><tr><td class="code"><pre><div class="line"><span class="meta">&lt;?php</span></div><div class="line">$records = <span class="keyword">array</span>(</div><div class="line">    <span class="keyword">array</span>(</div><div class="line">        <span class="string">'id'</span> =&gt; <span class="number">2135</span>,</div><div class="line">        <span class="string">'first_name'</span> =&gt; <span class="string">'John'</span>,</div><div class="line">        <span class="string">'last_name'</span> =&gt; <span class="string">'Doe'</span>,</div><div class="line">    ),</div><div class="line">    <span class="keyword">array</span>(</div><div class="line">        <span class="string">'id'</span> =&gt; <span class="number">3245</span>,</div><div class="line">        <span class="string">'first_name'</span> =&gt; <span class="string">'Sally'</span>,</div><div class="line">        <span class="string">'last_name'</span> =&gt; <span class="string">'Smith'</span>,</div><div class="line">    ),</div><div class="line">    <span class="keyword">array</span>(</div><div class="line">        <span class="string">'id'</span> =&gt; <span class="number">5342</span>,</div><div class="line">        <span class="string">'first_name'</span> =&gt; <span class="string">'Jane'</span>,</div><div class="line">        <span class="string">'last_name'</span> =&gt; <span class="string">'Jones'</span>,</div><div class="line">    ),</div><div class="line">    <span class="keyword">array</span>(</div><div class="line">        <span class="string">'id'</span> =&gt; <span class="number">5623</span>,</div><div class="line">        <span class="string">'first_name'</span> =&gt; <span class="string">'Peter'</span>,</div><div class="line">        <span class="string">'last_name'</span> =&gt; <span class="string">'Doe'</span>,</div><div class="line">    )</div><div class="line">);</div><div class="line"> </div><div class="line">$first_names = array_column($records, <span class="string">'first_name'</span>);</div><div class="line">print_r($first_names);</div><div class="line"><span class="meta">?&gt;</span></div><div class="line"><span class="comment">// 结果：</span></div><div class="line"><span class="keyword">Array</span></div><div class="line">(</div><div class="line">    [<span class="number">0</span>] =&gt; John</div><div class="line">    [<span class="number">1</span>] =&gt; Sally</div><div class="line">    [<span class="number">2</span>] =&gt; Jane</div><div class="line">    [<span class="number">3</span>] =&gt; Peter</div><div class="line">)</div></pre></td></tr></table></figure>
</li>
</ul>
<hr>
<h2 id="时间函数"><a href="#时间函数" class="headerlink" title="时间函数"></a>时间函数</h2><p><code>Time()</code>返回当前时间的时间戳<br><code>Date(‘Y-m-d H:i:s’,’’);</code>格式化一个时间<br>第一个参数：年月日时分秒</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <footer class="post-footer">
      

      
        
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/php/视频/" rel="next" title="视频">
                <i class="fa fa-chevron-left"></i> 视频
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/php/数组/" rel="prev" title="数组">
                数组 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div id="cloud-tie-wrapper" class="cloud-tie-wrapper"></div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="https://sfault-avatar.b0.upaiyun.com/416/326/4163260007-58a1621e63a68_huge256"
               alt="chimps" />
          <p class="site-author-name" itemprop="name">chimps</p>
           
              <p class="site-description motion-element" itemprop="description"></p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives">
                <span class="site-state-item-count">59</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">12</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">19</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
        </div>

        
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-1"><a class="nav-link" href="#匿名函数"><span class="nav-number">1.</span> <span class="nav-text">匿名函数:</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#官方解释"><span class="nav-number">1.1.</span> <span class="nav-text">官方解释:</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Closure对象"><span class="nav-number">1.2.</span> <span class="nav-text">Closure对象</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#bindTo"><span class="nav-number">1.3.</span> <span class="nav-text">bindTo</span></a></li></ol></li><li class="nav-item nav-level-1"><a class="nav-link" href="#函数赋值"><span class="nav-number">2.</span> <span class="nav-text">函数赋值</span></a></li><li class="nav-item nav-level-1"><a class="nav-link" href="#常见函数"><span class="nav-number">3.</span> <span class="nav-text">常见函数</span></a><ol class="nav-child"><li class="nav-item nav-level-2"><a class="nav-link" href="#数组函数"><span class="nav-number">3.1.</span> <span class="nav-text">数组函数</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#时间函数"><span class="nav-number">3.2.</span> <span class="nav-text">时间函数</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">chimps</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  








  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  


  




	





  
    
    <script>
      var cloudTieConfig = {
        url: document.location.href, 
        sourceId: "",
        productKey: "48bb30d8783d4b38ba0c95e0283238ca",
        target: "cloud-tie-wrapper"
      };
    </script>
    <script src="https://img1.ws.126.net/f2e/tie/yun/sdk/loader.js"></script>
  










  





  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  

  

  

</body>
</html>
